package com.allwees.bs.module.wms.service.impl;

import com.allwees.bs.core.modelbase.entity.WfBaseEntity;
import com.allwees.bs.module.base.service.impl.BoServiceImpl;
import com.allwees.bs.module.wms.dao.WmsShippingOrderSkuDao;
import com.allwees.bs.module.wms.entity.WmsPickOrderSku;
import com.allwees.bs.module.wms.entity.WmsShippingOrderSku;
import com.allwees.bs.module.wms.service.WmsShippingOrderSkuService;
import com.allwees.core.common.util.reflect.PojoUtil;
import org.springframework.stereotype.Service;

/**
 * wms 发货订单
 *
 * @author mouhn
 * @since 2020-01-08 13:56
 */
@Service
public class WmsShippingOrderSkuServiceImpl extends BoServiceImpl<WmsShippingOrderSkuDao, WmsShippingOrderSku> implements WmsShippingOrderSkuService {

    @Override
    public boolean create(String shippingOrderUuid, WmsPickOrderSku pickOrderSku) {
        WmsShippingOrderSku shippingOrderSku = PojoUtil.copyWithOmit(new WmsShippingOrderSku(), pickOrderSku, WfBaseEntity.fields)
                .setShippingQuantity(pickOrderSku.getPickQuantity());
        return create(shippingOrderSku);
    }
}
